DROP TABLE IF EXISTS jms_ods.yl_tms_cs_shift;
CREATE EXTERNAL TABLE jms_ods.yl_tms_cs_shift(
 ID bigint comment "主键自增id",  --NUMBER(11)
 SHIFT_CODE string comment "集散班次编码",  --NVARCHAR2(50)
 SHIFT_NAME string comment "集散班次名称",  --NVARCHAR2(50)
 NETWORK_CODE string comment "网点编码",  --NVARCHAR2(255)
 NETWORK_NAME string comment "网点名称",  --NVARCHAR2(255)
 OPERATION_TYPE string comment "作业类型: S:集货 ，C：散货，SC：集散货",  --NVARCHAR2(2)
 SHIFT_START_TIME string comment "班次开始时间",  --NVARCHAR2(10)
 SHIFT_END_TIME string comment "班次结束时间",  --NVARCHAR2(10)
 SPAN_DAYS bigint comment "跨越天数",  --NUMBER(11)
 APPLY_DAY string comment "适用工作日",  --NVARCHAR2(20)
 START_TIME timestamp comment "生效日期",  --DATE
 END_TIME timestamp comment "失效日期",  --DATE
 STATUS smallint comment "状态 0：待生效  1：生效 2：失效",  --NUMBER(4)
 CREATE_BY_NAME string comment "创建人姓名",  --NVARCHAR2(20)
 CREATE_TIME timestamp comment "创建时间",  --DATE
 LATEST_ARRIVAL_TIME string comment "最晚到车时间",  --NVARCHAR2(10)
 UPDATE_BY_NAME string comment "更新人姓名",  --NVARCHAR2(20)
 UPDATE_TIME timestamp comment "更新时间",  --DATE
 IS_DELETE smallint comment "是否删除,1未删除，2已删除",  --NUMBER(4)
 FRANCHISEE_CODE string comment "加盟商网点编码",  --NVARCHAR2(30)
 FRANCHISEE_NAME string comment "加盟商网点名称",  --NVARCHAR2(60)
 MAIN_DEF bigint comment "主班次编码"  --NUMBER(11)
 )
 COMMENT '网点集散班次'
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_ods.db/external/yl_tms_cs_shift'
 TBLPROPERTIES (
 'discover.partitions'='false',
 'parquet.column.index.access'='true'
 );

MSCK REPAIR TABLE jms_ods.yl_tms_cs_shift;